//**********************************************************************************
// Klasse RightMenuPanel - rechtes Menü
//
//
//**********************************************************************************
package binarytree.view;

import binarytree.view.commands.SetValuesOnOffCheckBox;
import binarytree.view.commands.ClearButton;
import binarytree.view.commands.SetAvlOnOffCheckbox;
import binarytree.view.output.OutputListPanel;
import binarytree.view.input.InputValuePanel;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.ActionListener;
import javax.swing.BorderFactory;
import javax.swing.JPanel;


public class RightMenuPanel extends JPanel {

    private final int ROWS = 10;
    private final int COLUMNS = 1;
    private final InputValuePanel inputValuePanel;
    private final OutputListPanel outputListPanel;
    private final ClearButton clearButton;
    private final SetAvlOnOffCheckbox avlCheckBox;
    private final SetValuesOnOffCheckBox setValuesOnOffCheckBox;

    public RightMenuPanel() {
        setBorder(BorderFactory.createTitledBorder("Menü"));
        setPreferredSize(new Dimension(200, 600));
        setLayout(new BorderLayout());
        inputValuePanel = new InputValuePanel();
        outputListPanel = new OutputListPanel();
        clearButton = new ClearButton();
        avlCheckBox = new SetAvlOnOffCheckbox();
        avlCheckBox.setSelected(true);
        setValuesOnOffCheckBox = new SetValuesOnOffCheckBox();
        JPanel buttonPanel = new JPanel();
        buttonPanel.setLayout(new BorderLayout());
        buttonPanel.add(clearButton, BorderLayout.PAGE_START);
        buttonPanel.add(avlCheckBox, BorderLayout.CENTER);
        buttonPanel.add(setValuesOnOffCheckBox, BorderLayout.PAGE_END);
        add(inputValuePanel, BorderLayout.PAGE_START);
        add(outputListPanel, BorderLayout.CENTER);
        add(buttonPanel, BorderLayout.PAGE_END);
    }

    public ClearButton getClearButton() {
        return clearButton;
    }

    public SetValuesOnOffCheckBox getSetValuesOnOffCheckBox() {
        return setValuesOnOffCheckBox;
    }
    
    public InputValuePanel getInputValuePanel() {
        return inputValuePanel;
    }

    public OutputListPanel getOutputListPanel() {
        return outputListPanel;
    }
    
    public SetAvlOnOffCheckbox getSetAvlOnOffCheckbox() {
        return avlCheckBox;
    }
    

    public void addClearButtonActionListener(ActionListener l) {
        clearButton.addActionListener(l);
    }
    
    public void addGetValuesButtonActionListener(ActionListener l) {
        setValuesOnOffCheckBox.addActionListener(l);
    }

    public void addSetAvlCheckboxActionListener(ActionListener l) {
        avlCheckBox.addActionListener(l);
    }
    
    
}
